﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
// 引入测试引用。
using Entity;
using DataAccess;
using CoreLogic;

namespace _Test
{
    class Program
    {
        static string line = "\r\n";

        static void Main(string[] args)
        {
            //AddUser();
            GetAllUsers();

            Console.WriteLine("\r\n------测试完成------");
            Console.ReadKey();
        }

        static void AddUser()
        {
            UserDAL dal = new UserDAL();

            // 准备用户实例对象（测试）。
            var usr = User.CreateUser();
            usr.UserName = "测试用户2";
            usr.Password = "test345";

            dal.AddUser(usr);
        }

        static void GetAllUsers()
        {
            UserDAL dal = new UserDAL();

            var usr_list = dal.GetAllUsers();

            foreach (var item in usr_list)
            {
                Console.WriteLine(item.Id.ToString() + line +
                    item.UserName + line +
                    item.Password + line +
                    item.RegisterDate.ToString("yyyy年MM月dd日 HH:mm:ss") + line);
            }
        }
    }
}
